package org.example;

import javax.swing.*;

public class Panel_4 extends JPanel {
    private JLabel type;
    private JComboBox<String> typeChoose;
    private JTextField inputAddress;
    private JLabel address;
    private JLabel port;
    private JTextField inputPort;
    private JLabel user;
    private JTextField inputUser;
    private JLabel password;
    private JTextField inputPassword;
    private JLabel domain;
    private JTextField inputDomain;
    private JButton test;
    private JCheckBox chooseServer;
    private JLabel setServerType;
    private JComboBox<String> serverTypeChoose;
    private JLabel loginServerAddress;
    private JComboBox<String> loginServerAddressChoose;

    public Panel_4() {
        this.addContent();
    }

    private void addContent() {
        this.setLayout(null);
        /**
         * 边框
         */
        this.setBorder(BorderFactory.createTitledBorder("网络设置"));
        /**
         * 类型
         */
        this.type = new JLabel();
        this.type.setText("类型:");
        this.type.setBounds(10, 22, 30, 15);
        this.add(this.type);
        /**
         * 类型选择
         */
        this.typeChoose = new JComboBox<>(new String[]{
                "不使用代理"
        });
        this.typeChoose.addItem("使用代理服务器");
        this.typeChoose.setBounds(55, 15, 120, 28);
        this.add(this.typeChoose);
        /**
         * 地址
         */
        this.address = new JLabel();
        this.address.setText("地址:");
        this.address.setBounds(10, 52, 30, 15);
        this.add(this.address);
        /**
         * 地址输入
         */
        this.inputAddress = new JTextField();
        this.inputAddress.setBounds(45, 50, 120, 20);
        this.add(this.inputAddress);
        /**
         * 端口
         */
        this.port = new JLabel();
        this.port.setText("端口:");
        this.port.setBounds(180, 52, 30, 15);
        this.add(this.port);
        /**
         * 端口输入
         */
        this.inputPort = new JTextField();
        this.inputPort.setBounds(215, 50, 100, 20);
        this.add(this.inputPort);
        /**
         * 用户
         */
        this.user = new JLabel();
        this.user.setText("用户:");
        this.user.setBounds(10, 77, 30, 15);
        this.add(this.user);
        /**
         * 用户输入
         */
        this.inputUser = new JTextField();
        this.inputUser.setBounds(45, 77, 120, 20);
        this.add(this.inputUser);
        /**
         * 密码
         */
        this.password = new JLabel();
        this.password.setText("密码:");
        this.password.setBounds(180, 77, 30, 15);
        this.add(this.password);
        /**
         * 密码输入
         */
        this.inputPassword = new JTextField();
        this.inputPassword.setBounds(215, 77, 100, 20);
        this.add(this.inputPassword);
        /**
         * 域（可不填）
         */
        this.domain = new JLabel();
        this.domain.setText("域(可不填):");
        this.domain.setBounds(10, 110, 70, 15);
        this.add(this.domain);
        /**
         * 输入域
         */
        this.inputDomain = new JTextField();
        this.inputDomain.setBounds(90, 107, 90, 20);
        this.add(this.inputDomain);
        /**
         * 测试（不可用）
         */
        this.test = new JButton();
        this.test.setText("测试");
        this.test.setBounds(255, 105, 60, 25);
        this.test.setEnabled(false);
        this.add(this.test);
        /**
         * 选择QQ登陆服务器
         */
        this.chooseServer = new JCheckBox("选择QQ登录服务器");
        this.chooseServer.setBounds(10, 140, 155, 20);
        this.add(chooseServer);
        /**
         * 设置你要登录到的服务器类型（不可用）
         */
        this.setServerType = new JLabel();
        this.setServerType.setText("设置你要登录到的服务器类型");
        this.setServerType.setBounds(10, 175, 175, 20);
        this.add(this.setServerType);
        /**
         * 选择设置你要登录到的服务器类型（不可用）
         */
        this.serverTypeChoose = new JComboBox<>(new String[]{
                "UDP类型"
        });
        this.serverTypeChoose.setBounds(185, 175, 120, 25);
        this.serverTypeChoose.setEnabled(false);
        this.add(this.serverTypeChoose);
        /**
         * 需要登录的服务器地址（不可用）
         */
        this.loginServerAddress = new JLabel();
        this.loginServerAddress.setText("需要登录的服务器地址");
        this.loginServerAddress.setBounds(10, 210, 130, 20);
        this.add(this.loginServerAddress);
        /**
         * 选择需要登录的服务器地址（不可用）
         */
        this.loginServerAddressChoose = new JComboBox<>(new String[]{
                "https://demo.if101.tv/"
        });
        this.loginServerAddressChoose.setBounds(140, 210, 120, 25);
        this.loginServerAddressChoose.setEnabled(false);
        this.add(this.loginServerAddressChoose);
    }
}
